<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Focus Manager</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
    <script>
      class PageRoot extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `
          <ion-header>
            <ion-toolbar>
              <ion-title aria-level="1" role="heading">Root</ion-title>
            </ion-toolbar>
          </ion-header>
          <ion-content class="ion-padding">
            <ion-nav-link router-direction="forward" component="page-one">
              <ion-button class="page-one">Go to Page One</ion-button>
            </ion-nav-link>
            <ion-nav-link router-direction="forward" component="page-two">
              <ion-button class="page-two">Go to Page Two</ion-button>
            </ion-nav-link>
            <ion-nav-link router-direction="forward" component="page-three">
              <ion-button class="page-three">Go to Page Three</ion-button>
            </ion-nav-link>
          </ion-content>
        `;
        }
      }
      class PageOne extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `
          <ion-header>
            <ion-toolbar>
              <ion-buttons slot="start">
                <ion-back-button></ion-back-button>
              </ion-buttons>
              <ion-title aria-level="1" role="heading">Page One</ion-title>
            </ion-toolbar>
          </ion-header>
          <ion-content class="ion-padding">
            Content
          </ion-content>
        `;
        }
      }
      class PageTwo extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `
          <ion-content class="ion-padding">
            Content
          </ion-content>
        `;
        }
      }
      class PageThree extends HTMLElement {
        connectedCallback() {
          this.innerHTML = `
          <ion-header>
            <ion-toolbar>
              <ion-buttons slot="start">
                <ion-back-button></ion-back-button>
              </ion-buttons>
            </ion-toolbar>
          </ion-header>
          <ion-content class="ion-padding">
            Content
          </ion-content>
        `;
        }
      }
      customElements.define('page-root', PageRoot);
      customElements.define('page-one', PageOne);
      customElements.define('page-two', PageTwo);
      customElements.define('page-three', PageThree);

      window.Ionic = {
        config: {
          focusManagerPriority: ['heading', 'banner', 'content'],
        },
      };
    </script>
  </head>

  <body>
    <ion-app>
      <ion-router>
        <ion-route url="/" component="page-root"></ion-route>
        <ion-route url="/page-one" component="page-one"></ion-route>
        <ion-route url="/page-two" component="page-two"></ion-route>
        <ion-route url="/page-three" component="page-three"></ion-route>
      </ion-router>
      <ion-nav></ion-nav>
    </ion-app>
  </body>
</html>
